<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>
<style>
    #header {
        height: 50px;
        background-color: #1d6dff;
        padding: 5px;
        text-align: center;
        position: relative;
    }

    #header .back {
        font-size: 20px;
        color: #ffffff;
        position: absolute;
        left: .2667rem;
        top: 20%;
    }

    #header .back img {
        width: 2rem;
        background-color: #ffffff;
    }

    #header>h4 {
        display: inline-block;
        text-align: center;
        font-size: 20px;
        color: #ffffff;
        padding-left: 30px;
        margin: .6667rem 0;
    }

    #header .back {
        display: block;
    }

    #header .app {
        position: absolute;
        right: .2667rem;
        top: 20%;
        padding: 7px;
    }

    #header .app img {
        height: 34px;
    }

    .dv1 {
        font: 1rem/1rem "";
        margin-bottom: 1.0667rem;
        color: gray;
    }
</style>

<body>
    <header id="header">
        <a href="./index.html" class="back fl"><img src="./assets/images/back.png" alt=""></a>
        <h4>省钱控-最新优惠</h4>
        <div class="app fr">
            <a href="">
                <img src="./assets/images/app.png" alt="">
            </a>
        </div>
    </header>
    <product>
        <div class="container">

        </div>
    </product>
</body>

</html>
<script src="./utils/utils.js"></script>
<script>
    function parcel() {
        let container = document.querySelector(".container")
        var i = location.href
        let reg = /(?<=\?).*/;
        let r = i.match(reg);
        let id = decodeURI(r)
        let obj = {};
        let itemArr = id.split(':');
        obj[itemArr[0]] = itemArr[1]

        function fn() {
            fetch('http://chst.vip:1234/api/getmoneyctrl')
                .then(body => body.json())
                .then(res => {
                    //console.log(res)
                    let obj1 = (res.result[obj.id])
                    //console.log(obj1)
                    let el = {}
                    let regExp = /(?<=imgurl=)[^'"]*/;
                    let r = obj1.productImg2.match(regExp)

                    el = ` <h3>${obj1.productName} </h3>
                    <div class="dv1">${obj1.productFrom}|${obj1.productTime} ${obj1.productTips}</div>
                    <div>
                        <img class="img1" src="${r}" width="200" alt="">
                        ${obj1.productInfo} ${obj1.productInfo1}
                    </div>
                        <img src="${r}" width="375" alt="">
                        `
                    container.innerHTML = el;
                })
        }
        
        fn()
    }
    parcel()
</script>